<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/web/login-and-regist-style.css">
    <title>Home Page</title>
    <style>
      .white-msg {
        color: white;
        padding: 20px;
        text-align: center;
        margin-top: 50px;
        border-radius: 8px;
      }
    </style>
  </head>
  <body>
    <div class="log_or_reg">
      <div class="white-msg">
      <%
        String username = (String) session.getAttribute("username");
        String times = String.valueOf(session.getAttribute("user_acccess_time"));
      %>
      <%!int i = 0; %>
      <%i++; %>
      <h1>Welcome, <%= username %></h1>
      <p>This is your <%=times %> time to visit this page. :)<p>
      <p style="font-size: 10px">This page has been visited cumulatively <%=i%> times.<p>
      <p style="font-size: 10px">Current Online user:<span><%=this.getServletConfig().getServletContext().getAttribute("online_count")%></span></p>
      </div>
      <a href="<%=request.getContextPath()%>/MainServlet">Logout</a>
    </div>
  </body>
</html>
